﻿using IrrKlang;
using IrrlichtLime;
using IrrlichtLime.Scene;
using LuaInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Timed;

namespace Iso.Common
{
    public class Engine
    {
        // The main IrrlichtDevice, SoundEngine and LuaManager
        public static IrrlichtDevice device;
        public static string baseData;
        public static ISoundEngine soundEngine;
        public static Dictionary<string, ISound> sounds;
        public static Lua lua;

        // Timeline
        public static uint then, now;
        public static float delta { get { now = device.Timer.Time; return (float)(now - then) / 1000.0f; } }
        public static uint currentTime { get { return device.Timer.RealTime; } }
        public static Timeline timeline;

        // Scene
        public static CameraSceneNode camera;
        public static IScene currentScene, nextScene;

        // Global Variables
        public static Dictionary<string, object> globalVariables;

        public static void LoadScene(IScene scene)
        {
            nextScene = scene;
        }

        public static void UnloadScene()
        {
            currentScene.Unload();
            currentScene = null;
        }
    }
}
